package com.yuven.baselib.component.viewmodel;

import androidx.lifecycle.MutableLiveData;

import com.yuven.baselib.component.bean.DialogBean;

/**
 * 
 *
 * @author :        Yuven
 * @date :          2022/7/6 7:18 下午
 * @desc :
 */
public class DialogLiveData<T> extends MutableLiveData<T> {

    private DialogBean dialogBean = new DialogBean(false, "");

    public void setValue(boolean isShow) {
        setValue(isShow, "");
    }

    public void setValue(boolean isShow, String msg) {
        setValue(isShow, msg, true);
    }

    public void setValue(boolean isShow, String msg, boolean cancelable) {
        dialogBean.setShow(isShow);
        dialogBean.setMsg(msg);
        dialogBean.setCancelable(cancelable);
        super.setValue((T) dialogBean);
    }
}
